{$CLEO .cs}
{$USE CLEO+}
{$USE Audio}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "Gasoline Mod"

// By ArtemQa146

if
    0AA2: 31@ = load_dynamic_library "CLEO+.cleo"
then
    if
        0AA4: 30@ = get_dynamic_library_procedure "GetCleoPlusVersion" library 31@
    then
        0AA7: call_function_return 30@ num_params 0 pop 0 29@
        if
            not 29@ >= 0x1020000
        then
            0AD1: show_formatted_text_highpriority "Cleo+ 1.2.0 (or higher) version is required, the Gasoline mod is disabled" time 15000
            0AA3: free_dynamic_library 31@
            0A93: terminate_this_custom_script
        end
        0AA3: free_dynamic_library 31@
    end
else
    0AD1: show_formatted_text_highpriority "Cleo+ 1.2.0 (or higher) version is required, the Gasoline mod is disabled" time 15000
    0AA3: free_dynamic_library 31@
    0A93: terminate_this_custom_script
end


if
    is_game_first_start
then
    0F00: load_special_model_dff "modelsqa\PetrolCanQ" txd "modelsqa\PetrolCanQ" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\Gasoline Mod.ini" section "Models" key "PetrolCan"
    
    0F00: load_special_model_dff "modelsqa\PetrolCanQB" txd "modelsqa\PetrolCanQ" store_to 0@
    0AF1: write_int 0@ to_ini_file "cleo\Gasoline Mod.ini" section "Models" key "PetrolCanB"
end

const
    Car_gasoline = 0@
    Line_png = 31@
    Point_png = 30@
    Gasoline_png = 29@
    Line_Position_X = 28@
    Line_Position_Y = 27@
    Line_size_x = 26@
    Line_size_y = 25@
    Line_alpha = 24@
    Time_gas = 23@
    Battery_icon = 22@
    Bit_sets = 21@
    Sound_Play = 18@
    Sound_gasUp_volume = 20@
    Arrow_A = 19@
    Sound_volume = 17@
    Find_obj = 9@ // Red_color    
    Gas_station = 10@ // Green_color    
    Full_mark = 16@
    Size_icon = 15@
    Gas_up_icon = 14@
    Line_2_png = 13@
    Line_frame_alpha = 12@
    no_money = 11@
    Gas_full = 1000
    Gas_empty = 55
    Red_color = 9@
    Green_color = 10@
    Sound_Gus = 10
    Sound_war = 11
    HUD_Enabled_bit = 0
    Car_bit = 1
    Big_Car_bit = 2
    Quad_bit = 3
    Heli_bit = 4
    Plane_bit = 5
    Boat_bit = 6
    Bike_bit = 7
    Mode_Default = 12
    Mode_Everytime = 13
    Mode_off = 14
    Line_Static_Color = 15
    Line_Color_R = 16
    Line_Color_G = 17
    Line_Color_B = 18
    Line_Color_Y = 19
    Line_Color_W = 20
    Line_Color_BK = 21
    Icon_Position_1 = 22
    Icon_Position_2 = 23
    Icon_Position_3 = 24
    Mode_V = 25
    Mode_H = 26
    Oil_leaking = 27
    Icon = 28
    Mode_trur_Everytime = 29
    Mode_Vanilla = 30
    onMission = 31
end

Sound_Play = -1

gosub @Visual_INI

08C3: clear Bit_sets bit Sound_Gus
08C3: clear Bit_sets bit Sound_War

08C3: clear Bit_sets bit Mode_V
08C3: clear Bit_sets bit Mode_H
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Mode"
if 0@ == 1
then 08BD: set Bit_sets bit Mode_H
end
if 0@ == 2
then 08BD: set Bit_sets bit Mode_V
end

08C3: clear Bit_sets bit Mode_Vanilla
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Classic Style"
if 0@ == 1
then 08BD: set Bit_sets bit Mode_Vanilla
end

0390: load_txd_dictionary "GSMOD"
if 08B7:   test Bit_sets bit Mode_H
then 038F: load_texture "Line" as 1  // Load dictionary with 0390 first
else 038F: load_texture "LineV" as 1  // Load dictionary with 0390 first
end
if 08B7:   test Bit_sets bit Mode_Vanilla
then
    if 08B7:   test Bit_sets bit Mode_H
    then 038F: load_texture "line8" as 2  // Load dictionary with 0390 first
    else 038F: load_texture "line9" as 2  // Load dictionary with 0390 first
    end
else 038F: load_texture "point" as 2  // Load dictionary with 0390 first
end
038F: load_texture "GSST" as 3  // Load dictionary with 0390 first
038F: load_texture "full" as 4  // Load dictionary with 0390 first
038F: load_texture "gsup" as 5  // Load dictionary with 0390 first
if 08B7:   test Bit_sets bit Mode_H
then 038F: load_texture "Line2" as 6  // Load dictionary with 0390 first
else 038F: load_texture "Line2V" as 6  // Load dictionary with 0390 first
end
038F: load_texture "mone" as 7  // Load dictionary with 0390 first
038F: load_texture "batt" as 8  // Load dictionary with 0390 first
038F: load_texture "GSST2" as 9  // Load dictionary with 0390 first
0E3C: get_texture_from_sprite 1 store_to Line_png
0E3C: get_texture_from_sprite 2 store_to Point_png
0E3C: get_texture_from_sprite 3 store_to Gasoline_png
0E3C: get_texture_from_sprite 4 store_to Full_mark
0E3C: get_texture_from_sprite 5 store_to Gas_up_icon
0E3C: get_texture_from_sprite 6 store_to Line_2_png
0E3C: get_texture_from_sprite 7 store_to no_money
0E3C: get_texture_from_sprite 8 store_to Battery_icon
0E3C: get_texture_from_sprite 9 store_to 5@
0391: release_textures

0AF0: 2@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Map Icon R"
0AF0: 3@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Map Icon G"
0AF0: 4@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Map Icon B"

0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Map Icon"

if
    0@ == 1
then
    0E2A: add_cleo_blip 5@ position 1944.852 -1769.554 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 2209.816 2481.934 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 604.8804 1705.273 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -2414.49 982.081 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -2244.623 -2561.828 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -1327.512 2678.107 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -95.1488 -1174.303 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -1679.982 408.9051 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 652.03 -571.34 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -1605.897 -2714.252 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -1471.48 1864.31 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 1596.5 2199.1 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 2145.9 2748.16 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 2642.11 1106.53 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 2117.42 920.42 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 1381.68 456.26 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position 1005.3403 -936.0178 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    0E2A: add_cleo_blip 5@ position -741.2739 2740.3254 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@

    //   SAxVCxLC .
    0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "SAxVCxLC Icons"
    if
        0@ == 1
    then
        0E2A: add_cleo_blip 5@ position 8467.0 10811.0 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
        0E2A: add_cleo_blip 5@ position 9076.0 8924.0 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
        0E2A: add_cleo_blip 5@ position 8303.0 -9312.0 is_short 1 RGBA 2@ 3@ 4@ 255 store_to 1@
    end
end

// 0x8 -  
// 0x9 -  


while true
    wait 0
    if
        player.Defined(0)
    then
        if and
            $ACTIVE_INTERIOR == 0
            00DF:   actor $PLAYER_ACTOR driving
        then
        
            if
                not $ONMISSION == 0
            then
                if
                    08B7:   test Bit_sets bit onMission
                then
                else
                    0AAA: 1@ = get_script_struct_named "UMARA69" //   69
                    if
                        1@ == 0
                    then
                        continue
                    end
                end
            end
            
            03C0: Car_gasoline = actor $PLAYER_ACTOR car
            0E12: get_vehicle Car_gasoline subclass_to 1@
            2@ = false
            if 1@ == 0 // 
            then
                if 08B7:   test Bit_sets bit Car_bit
                then 2@ = true
                end
            end
            
            if 1@ == 1 //   (    )
            then
                if 08B7:   test Bit_sets bit Big_Car_bit
                then 2@ = true
                end
            end
            
            if 1@ == 2 // 
            then
                if 08B7:   test Bit_sets bit Quad_bit
                then 2@ = true
                end
            end
            
            if 1@ == 3 // 
            then
                if 08B7:   test Bit_sets bit Heli_bit
                then 2@ = true
                end
            end
            
            if 1@ == 4 // 
            then
                if 08B7:   test Bit_sets bit Plane_bit
                then 2@ = true
                end
            end
            
            if 1@ == 5 // 
            then
                if 08B7:   test Bit_sets bit Boat_bit
                then 2@ = true
                end
            end
            
            if 1@ == 9 // 
            then
                if 08B7:   test Bit_sets bit Bike_bit
                then 2@ = true
                end
            end
            
            if
                2@ == true
            then
                046C: 1@ = car Car_gasoline driver
                if and
                    8119:   not car Car_gasoline wrecked
                    //not is_car_script_controlled Car_gasoline
                    003B:   1@ == $PLAYER_ACTOR  // (int)
                then
                    0A97: 1@ = car Car_gasoline struct
                    0D4E: 2@ = struct 1@ offset 0x8 size 1
                    if
                        08B7:   test 2@ bit 1 //   
                    then
                    
                        if
                            0ADC:   test_cheat "gasReload" //   
                        then
                            gosub @Visual_INI
                            print_help_string "Visual Settings Reloaded"
                            continue
                        end
                        
                        if
                            0ADC:   test_cheat "gasolineQa" //  
                        then
                            0A97: 1@ = car Car_gasoline struct
                            0E28: write_struct 1@ offset 0x9 size 4 value Gas_full
                            03E5: show_text_box 'CHEAT1'
                            0623: add 1 to_integer_stat 137 //     
                            continue
                        end

                        // 
                        0E12: get_vehicle Car_gasoline subclass_to 1@
                        if or
                            0137:   car Car_gasoline model == 539
                            1@ == 5
                        then
                            0AAA: 1@ = get_script_struct_named "GasB"
                            if
                                1@ == 0
                            then
                                1@ = true
                                0A92: stream_custom_script "GasStationBoat.qa" 1@ Car_gasoline
                                wait 300
                                continue
                            end
                        end
                        
                        //  
                        0E12: get_vehicle Car_gasoline subclass_to 1@
                        if or
                            1@ == 3
                            1@ == 4
                        then
                            0AAA: 1@ = get_script_struct_named "GasP"
                            if and
                                8137:   not car Car_gasoline model == 539
                                1@ == 0
                            then
                                1@ = true
                                0A92: stream_custom_script "GasStationPlane.qa" 1@ Car_gasoline
                                wait 300
                                continue
                            end
                        end
                        
                        
                        //    
                        gosub @Stopped
                        if
                            1@ == true //   
                        then

                                //     (  )
                                0407: store_coords_to 1@ 2@ 3@ from_car Car_gasoline with_offset 0.0 0.0 0.0
                                0AA7: call_function_return 0x5693F0 num_params 9 pop 9 0 0 0 0 1 0 10.0 1@v 3465 Gas_station
                                if
                                    Gas_station > 0
                                then
                                    0EEE: get_entity_coordinates Gas_station store_to 1@ 2@ 3@
                                    if and
                                        01C1:   car Car_gasoline stopped
                                        0EEB: locate_car_distance_to_coordinates Car_gasoline pos 1@ 2@ 3@ radius 5.0
                                    then
                                        gosub @Electro_engine
                                        if and
                                            not 3@ == 69
                                            8969:   not car Car_gasoline is_big
                                            88B7:   not test Bit_sets bit Mode_Off
                                        then
                                            3@ = false
                                            
                                            0E12: get_vehicle Car_gasoline subclass_to 1@
                                            if or
                                                1@ == 0
                                                1@ == 9
                                            then

                                                if or
                                                    08B7:   test Bit_sets bit Mode_Default
                                                    08B7:   test Bit_sets bit Mode_Everytime
                                                    08B7:   test Bit_sets bit Mode_trur_Everytime
                                                then
                                                    0A97: 1@ = car Car_gasoline struct
                                                    0D4E: 2@ = struct 1@ offset 0x9 size 4
                                                    3@ = Gas_full
                                                        if 08B7:   test Bit_sets bit Mode_Default
                                                        then 3@ /= 4
                                                        end
                                                        if 08B7:   test Bit_sets bit Mode_Everytime
                                                        then 3@ -= 150
                                                        end
                                                        if 08B7:   test Bit_sets bit Mode_trur_Everytime
                                                        then 3@ -= 5
                                                        end

                                                    if
                                                        001D:   3@ > 2@  // (int)
                                                    then
                                                        3@ = true
                                                    else
                                                        3@ = false
                                                    end
                                                end

                                                if
                                                    3@ == true
                                                then
                                                    3@ = Gas_full
                                                    0062: 3@ -= 2@  // (int)
                                                    3@ /= 7
                                                    if
                                                        010A:   player $PLAYER_CHAR money > 3@
                                                    then
                                                        3@ *= -1
                                                        0109: player $PLAYER_CHAR money += 3@
                                                        0E28: write_struct 1@ offset 0x9 size 4 value Gas_full
                                                        1@ = true
                                                        0A92: stream_custom_script "GasStation.qa" 1@ Car_gasoline
                                                        repeat
                                                        wait 300
                                                        0AAA: 1@ = get_script_struct_named "GasST"
                                                        until 1@ == 0
                                                        continue
                                                    end
                                                end
                                            end
                                        end
                                        gosub @Petrol // 
                                    end
                                end

                                //    
                                Find_obj = 0
                                while 0EA9: get_any_object_no_save_recursive Find_obj progress_to Find_obj object_to Gas_station
                                    if or
                                        09CC:   object Gas_station model_is 1686
                                        09CC:   object Gas_station model_is 1676
                                        09CC:   object Gas_station model_is 3465
                                        09CC:   object Gas_station model_is 1244
                                    then
                                        if and
                                            8366:   not object Gas_station damaged
                                            01C1:   car Car_gasoline stopped
                                            0EE7: locate_car_distance_to_object Car_gasoline object Gas_station radius 5.0
                                        then
                                            gosub @Electro_engine
                                            if and
                                                not 3@ == 69
                                                8969:   not car Car_gasoline is_big
                                                88B7:   not test Bit_sets bit Mode_Off
                                            then
                                                3@ = false
                                                
                                                0E12: get_vehicle Car_gasoline subclass_to 1@
                                                if or
                                                    1@ == 0
                                                    1@ == 9
                                                then
                                                    if or
                                                        08B7:   test Bit_sets bit Mode_Default
                                                        08B7:   test Bit_sets bit Mode_Everytime
                                                        08B7:   test Bit_sets bit Mode_trur_Everytime
                                                    then
                                                        0A97: 1@ = car Car_gasoline struct
                                                        0D4E: 2@ = struct 1@ offset 0x9 size 4
                                                        3@ = Gas_full
                                                            if 08B7:   test Bit_sets bit Mode_Default
                                                            then 3@ /= 4
                                                            end
                                                            if 08B7:   test Bit_sets bit Mode_Everytime
                                                            then 3@ -= 150
                                                            end
                                                            if 08B7:   test Bit_sets bit Mode_trur_Everytime
                                                            then 3@ -= 5
                                                            end
                                                        if
                                                            001D:   3@ > 2@  // (int)
                                                        then
                                                            3@ = true
                                                        else
                                                            3@ = false
                                                        end
                                                    end

                                                    if
                                                        3@ == true
                                                    then
                                                        3@ = Gas_full
                                                        0062: 3@ -= 2@  // (int)
                                                        3@ /= 7
                                                        if
                                                            010A:   player $PLAYER_CHAR money > 3@
                                                        then
                                                            3@ *= -1
                                                            0109: player $PLAYER_CHAR money += 3@
                                                            0E28: write_struct 1@ offset 0x9 size 4 value Gas_full
                                                            1@ = true
                                                            0A92: stream_custom_script "GasStation.qa" 1@ Car_gasoline
                                                            repeat
                                                            wait 300
                                                            0AAA: 1@ = get_script_struct_named "GasST"
                                                            until 1@ == 0
                                                            break
                                                        end
                                                    end
                                                end
                                            end
                                            gosub @Petrol // 
                                        end
                                    end
                                end
                            
                            if 856E:   not car Car_gasoline defined
                            then continue
                            end
                            
                            //   
                            0E12: get_vehicle Car_gasoline subclass_to 1@
                            if or
                                1@ == 3
                                1@ == 4
                            then
                                if
                                    8137:   not car Car_gasoline model == 539
                                then
                                    if or
                                        0EEB: locate_car_distance_to_coordinates Car_gasoline pos 357.8 2539.9 16.7 radius 30.0 //  
                                        0EEB: locate_car_distance_to_coordinates Car_gasoline pos 1410.4 1790.9 10.8 radius 30.0 // LV
                                        0EEB: locate_car_distance_to_coordinates Car_gasoline pos 1434.4 -2453.4 13.5 radius 30.0 // LS
                                        0EEB: locate_car_distance_to_coordinates Car_gasoline pos -1164.0 -199.5 14.1 radius 30.0 // SF
                                    then
                                        gosub @Petrol // 
                                    end
                                end
                            end
                            
                            //   
                            0E12: get_vehicle Car_gasoline subclass_to 1@
                            if or
                                0137:   car Car_gasoline model == 539
                                1@ == 5
                            then
                                if or
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos -2192.2026 2451.7988 1.4503 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos -1679.1454 1476.4565 1.2309 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos -1635.8868 187.7887 0.6777 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos 192.7418 -1947.5878 1.4659 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos 2702.3762 -2294.0823 1.4937 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos 2313.3 514.686 1.6188 radius 30.0
                                    0EEB: locate_car_distance_to_coordinates Car_gasoline pos 258.6 2959.2 1.0 radius 30.0
                                then
                                    gosub @Petrol // 
                                end
                            end
                            
                        else
                            gosub @Sound_remove_gasup
                        end
                        
                        if and
                            is_hud_visible
                            is_local_var_bit_set_const Bit_Sets HUD_Enabled_bit
                        then
                            //      
                            0087: 3@ = Line_Position_X // (float)
                            0087: 4@ = Line_Position_Y // (float)
                            0087: 7@ = Line_size_x // (float)
                            0087: 8@ = Line_size_y // (float
                            
                            //      
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 2@ = struct 1@ offset 0x9 size 4
                            
                            // 
                            2@ /= 4
                            if 2@ > 255
                            then 2@ = 255
                            end
                            if 2@ < 15
                            then 2@ = 15
                            end
                                
                            // 
                            0085: 5@ = 2@ // (int)
                            1@ = 255
                            0062: 1@ -= 5@  // (int)
                            
                            //       
                            0085: Red_color = 1@ // (int)
                            0085: Green_color = 2@ // (int)
                            1@ = 0
                            
                            if
                                08B7:   test Bit_sets bit Line_Static_Color
                            then
                                if
                                    08B7:   test Bit_sets bit Line_Color_R
                                then
                                    Red_color = 255
                                    2@ = 0
                                    1@ = 0
                                end
                                if
                                    08B7:   test Bit_sets bit Line_Color_G
                                then
                                    Red_color = 0
                                    2@ = 255
                                    1@ = 0
                                end
                                if
                                    08B7:   test Bit_sets bit Line_Color_B
                                then
                                    Red_color = 0
                                    2@ = 0
                                    1@ = 255
                                end
                                if
                                    08B7:   test Bit_sets bit Line_Color_Y
                                then
                                    Red_color = 255
                                    2@ = 255
                                    1@ = 0
                                end
                                if
                                    08B7:   test Bit_sets bit Line_Color_W
                                then
                                    Red_color = 255
                                    2@ = 255
                                    1@ = 255
                                end
                                if
                                    08B7:   test Bit_sets bit Line_Color_Bk
                                then
                                    Red_color = 0
                                    2@ = 0
                                    1@ = 0
                                end
                            end
    
                            if and
                                08B7:   test Bit_sets bit Mode_V
                                88B7:   not test Bit_sets bit Mode_Vanilla
                            then
                            
                            //  
                            0E1E: draw_texture_plus Line_png event 1 pos 3@ 4@ size 8@ 7@ angle 0.0 depth 0 0 0 0 rgba 0 0 0 Line_frame_alpha
                            0E1E: draw_texture_plus Line_2_png event 1 pos 3@ 4@ size 8@ 7@ angle 0.0 depth 0 0 0 0 rgba Red_color 2@ 1@ Line_alpha
                            
                            
                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            0087: 5@ = 4@ // (float)
                            005B: 5@ += 1@  //   
                            0087: 6@ = 4@ // (float)
                            0063: 6@ -= 1@  //   
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 2@ = struct 1@ offset 0x9 size 4 //  
                            0093: 2@ = integer 2@ to_float
                            1@ = Gas_full
                            1@ += 55 // ,     
                            0093: 1@ = integer 1@ to_float
                            0073: 1@ /= 2@ //      
                            0087: 2@ = 7@ //   
                            0073: 2@ /= 1@ //       ,    
                            0063: 5@ -= 2@  // (float)
    
                            0087: 1@ = 8@ //   
                            1@ /= 1.5
                            
                            //  
                            0E1E: draw_texture_plus Point_png event 1 pos 3@ 5@ size 1@ 1@ angle 90.0 depth 0 1 0 0 rgba 0 0 0 Arrow_A
                            
                            0087: 5@ = Line_Position_Y // (float)
                            0087: 4@ = Line_Position_X // (float)
                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            005B: 5@ += 1@  // (float)
                            0087: 1@ = 8@ //  
                            1@ /= 1.5 //  
                            if or
                                08B7:   test Bit_sets bit Icon_Position_1
                                08B7:   test Bit_sets bit Icon_Position_3
                            then
                                0063: 5@ -= 1@  //  
                            end
                            if
                                08B7:   test Bit_sets bit Icon_Position_2
                            then
                                005B: 5@ += 1@  //   X
                            end
    
                            1@ /= 1.5 //    X
                            
                            if
                                08B7:   test Bit_sets bit Icon_Position_3
                            then
                                0063: 4@ -= 1@  //   X
                            else
                                if
                                    08B7:   test Bit_sets bit Icon_Position_1
                                then
                                    005B: 4@ += 1@  //   X
                                end
                            end
                        
                        

                        end

                         // Horizontal
                        
                        if and
                            08B7:   test Bit_sets bit Mode_h
                            88B7:   not test Bit_sets bit Mode_Vanilla
                        then
                        
                        
                        
                        //  
                        0E1E: draw_texture_plus Line_png event 1 pos 3@ 4@ size 7@ 8@ angle 0.0 depth 0 0 0 0 rgba 0 0 0 Line_frame_alpha
                        0E1E: draw_texture_plus Line_2_png event 1 pos 3@ 4@ size 7@ 8@ angle 0.0 depth 0 0 0 0 rgba Red_color 2@ 1@ Line_alpha
                        

                        //   
                        0087: 1@ = 7@ //  
                        1@ /= 2.0 //   
                        0087: 5@ = 3@ // (float)
                        0063: 5@ -= 1@  //   
                        0087: 6@ = 3@ // (float)
                        005B: 6@ += 1@  //   
                        0A97: 1@ = car Car_gasoline struct
                        0D4E: 2@ = struct 1@ offset 0x9 size 4 //  
                        0093: 2@ = integer 2@ to_float
                        1@ = Gas_full
                        1@ += 55 // ,     
                        0093: 1@ = integer 1@ to_float
                        0073: 1@ /= 2@ //      
                        0087: 2@ = 7@ //   
                        0073: 2@ /= 1@ //       ,    
                        005B: 5@ += 2@  //    

                        0087: 1@ = 8@ //   
                        1@ /= 1.5

                        //  
                        0E1E: draw_texture_plus Point_png event 1 pos 5@ 4@ size 1@ 1@ angle 0.0 depth 0 1 0 0 rgba 0 0 0 Arrow_A
                        
                        //   
                        0087: 1@ = 7@ //  
                        1@ /= 2.0 //   
                        0087: 5@ = 3@ // (float)
                        0063: 5@ -= 1@  //   
                        0087: 1@ = 8@ //  
                        1@ /= 1.9 //  
                        if
                            08B7:   test Bit_sets bit Icon_Position_1
                        then
                            0063: 4@ -= 1@  //  
                        end
                        if
                            08B7:   test Bit_sets bit Icon_Position_2
                        then
                            005B: 4@ += 1@  //   X
                        end

                        1@ /= 1.5 //    X

                        if
                            08B7:   test Bit_sets bit Icon_Position_3
                        then
                            0063: 5@ -= 1@  //   X
                        else
                            005B: 5@ += 1@  //   X
                        end
                        
                        
                        
                        end
                        
                        
                        
                        
                        
                        
                        
                        if
                            08B7:   test Bit_sets bit Mode_Vanilla
                        then
                        
                            if
                                08B7:   test Bit_sets bit Mode_h
                            then

                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            0087: 5@ = 3@ // (float)
                            0063: 5@ -= 1@  //   
                            0087: 1@ = 7@ //  
                            1@ /= 100.0 //   
                            1@ *= 4.9
                            005B: 5@ += 1@  // (float)

                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 2@ = struct 1@ offset 0x9 size 4 //  
                            0093: 2@ = integer 2@ to_float
                            1@ = Gas_full
                            0093: 1@ = integer 1@ to_float
                            0073: 1@ /= 2@ //      
                            0087: 2@ = 7@ //   
                            0073: 2@ /= 1@ //       ,    
                        
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 6@ = struct 1@ offset 0x9 size 4 //  
                            0093: 6@ = integer 6@ to_float
                            6@ /= 1000.0
                            6@ *= 2.0
                            006B: 2@ *= 6@  // (float)
                            //2@ *= 2.0
                        
                            //      
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 1@ = struct 1@ offset 0x9 size 4

                            // 
                            1@ /= 4
                            if 1@ > 255
                            then 1@ = 255
                            end
                            if 1@ < 15
                            then 1@ = 15
                            end

                            // 
                            0085: 6@ = 1@ // (int)
                            9@ = 255
                            0062: 9@ -= 6@  // (int)

                            //       
                            0085: Red_color = 9@ // (int)
                            0085: Green_color = 1@ // (int)
                            1@ = 0
                            
                            if
                            08B7:   test Bit_sets bit Line_Static_Color
                            then
                            
                            if
                                08B7:   test Bit_sets bit Line_Color_R
                            then
                                Red_color = 255
                                Green_color = 0
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_G
                            then
                                Red_color = 0
                                Green_color = 255
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_B
                            then
                                Red_color = 0
                                Green_color = 0
                                1@ = 255
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_Y
                            then
                                Red_color = 255
                                Green_color = 255
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_W
                            then
                                Red_color = 255
                                Green_color = 255
                                1@ = 255
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_Bk
                            then
                                Red_color = 0
                                Green_color = 0
                                1@ = 0
                            end
                            
                            end

                            //  
                            0E1E: draw_texture_plus Line_2_png event 1 pos 3@ 4@ size 7@ 8@ angle 180.0 depth 0 0 0 0 rgba 100 100 100 200
                            0E1E: draw_texture_plus Line_png event 1 pos 3@ 4@ size 7@ 8@ angle 180.0 depth 0 0 0 0 rgba 0 0 0 Line_frame_alpha
                            0E1E: draw_texture_plus Point_png event 1 pos 5@ 4@ size 2@ 8@ angle 180.0 depth 0 0 0 0 rgba Red_color Green_color 1@ Line_alpha
                        
                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            0087: 5@ = 3@ // (float)
                            0063: 5@ -= 1@  //   
                            0087: 1@ = 8@ //  
                            1@ /= 1.9 //  
                            if
                                08B7:   test Bit_sets bit Icon_Position_1
                            then
                                0063: 4@ -= 1@  //  
                            end
                            if
                                08B7:   test Bit_sets bit Icon_Position_2
                            then
                                005B: 4@ += 1@  //   X
                            end

                            1@ /= 1.5 //    X

                            if
                                08B7:   test Bit_sets bit Icon_Position_3
                            then
                                0063: 5@ -= 1@  //   X
                            else
                                005B: 5@ += 1@  //   X
                            end
                            
                            
                            

                            else // verti
                            
                            
                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            0087: 5@ = 4@ // (float)
                            005B: 5@ += 1@  //   
                            0087: 1@ = 7@ //  
                            1@ /= 100.0 //   
                            1@ *= 4.9
                            0063: 5@ -= 1@  // (float)

                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 2@ = struct 1@ offset 0x9 size 4 //  
                            0093: 2@ = integer 2@ to_float
                            1@ = Gas_full
                            0093: 1@ = integer 1@ to_float
                            0073: 1@ /= 2@ //      
                            0087: 2@ = 7@ //   
                            0073: 2@ /= 1@ //       ,    

                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 6@ = struct 1@ offset 0x9 size 4 //  
                            0093: 6@ = integer 6@ to_float
                            6@ /= 1000.0
                            6@ *= 2.0
                            006B: 2@ *= 6@  // (float)
                            //2@ *= 2.0

                            //      
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 1@ = struct 1@ offset 0x9 size 4

                            // 
                            1@ /= 4
                            if 1@ > 255
                            then 1@ = 255
                            end
                            if 1@ < 15
                            then 1@ = 15
                            end

                            // 
                            0085: 6@ = 1@ // (int)
                            9@ = 255
                            0062: 9@ -= 6@  // (int)

                            //       
                            0085: Red_color = 9@ // (int)
                            0085: Green_color = 1@ // (int)
                            1@ = 0
                            
                            if
                            08B7:   test Bit_sets bit Line_Static_Color
                            then

                            if
                                08B7:   test Bit_sets bit Line_Color_R
                            then
                                Red_color = 255
                                Green_color = 0
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_G
                            then
                                Red_color = 0
                                Green_color = 255
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_B
                            then
                                Red_color = 0
                                Green_color = 0
                                1@ = 255
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_Y
                            then
                                Red_color = 255
                                Green_color = 255
                                1@ = 0
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_W
                            then
                                Red_color = 255
                                Green_color = 255
                                1@ = 255
                            end
                            if
                                08B7:   test Bit_sets bit Line_Color_Bk
                            then
                                Red_color = 0
                                Green_color = 0
                                1@ = 0
                            end

                            end

                            //  
                            0E1E: draw_texture_plus Line_2_png event 1 pos 3@ 4@ size 8@ 7@ angle 0.0 depth 0 0 0 0 rgba 100 100 100 200
                            0E1E: draw_texture_plus Line_png event 1 pos 3@ 4@ size 8@ 7@ angle 0.0 depth 0 0 0 0 rgba 0 0 0 Line_frame_alpha
                            0E1E: draw_texture_plus Point_png event 1 pos 3@ 5@ size 8@ 2@ angle 0.0 depth 0 0 0 0 rgba Red_color Green_color 1@ Line_alpha
                            
                            
                            0087: 5@ = Line_Position_Y // (float)
                            0087: 4@ = Line_Position_X // (float)
                            //   
                            0087: 1@ = 7@ //  
                            1@ /= 2.0 //   
                            005B: 5@ += 1@  // (float)
                            0087: 1@ = 8@ //  
                            1@ /= 1.5 //  
                            if or
                                08B7:   test Bit_sets bit Icon_Position_1
                                08B7:   test Bit_sets bit Icon_Position_3
                            then
                                0063: 5@ -= 1@  //  
                            end
                            if
                                08B7:   test Bit_sets bit Icon_Position_2
                            then
                                005B: 5@ += 1@  //   X
                            end

                            1@ /= 1.5 //    X

                            if
                                08B7:   test Bit_sets bit Icon_Position_3
                            then
                                0063: 4@ -= 1@  //   X
                            else
                                if
                                    08B7:   test Bit_sets bit Icon_Position_1
                                then
                                    005B: 4@ += 1@  //   X
                                end
                            end
                            
                            end

                        end
                        
                        end
                        
                        
                        
                        //    1/4     
                        0A97: 3@ = car Car_gasoline struct
                        0D4E: 7@ = struct 3@ offset 0x9 size 4
                        3@ = Gas_full
                        3@ /= 4
                        6@ = 100
                        if
                            001D:   3@ > 7@  // (int)
                        then
                            gosub @Sound_load
                            
                            //  
                            if
                                timerb > 500
                            then
                            
                            
                                //      
                                0A97: 1@ = car Car_gasoline struct
                                0D4E: 2@ = struct 1@ offset 0x9 size 4

                                // 
                                2@ /= 4
                                if 2@ > 255
                                then 2@ = 255
                                end
                                if 2@ < 15
                                then 2@ = 15
                                end

                                // 
                                0085: 6@ = 2@ // (int)
                                1@ = 255
                                0062: 1@ -= 6@  // (int)
                            
                            
                                6@ = 255
                                7@ = 0
                                if
                                    timerb > 1000
                                then
                                    timerb = 0
                                    if and
                                        88B7:   not test Bit_sets bit Sound_Gus
                                        not Sound_Play == -1
                                    then
                                        0AAD: set_audio_stream Sound_Play state 1
                                    end
                                end
                            else
                                6@ = 100
                                1@ = 200
                                2@ = 200
                                7@ = 200
                            end
                        else
                            1@ = 200
                            2@ = 200
                            7@ = 200
                            gosub @Sound_remove
                        end
                        
                        gosub @Electro_engine

                        
                        if and
                            0EB9: is_hud_visible
                            is_local_var_bit_set_const Bit_Sets HUD_Enabled_bit
                        then
                            if
                                08B7:   test Bit_sets bit Mode_V
                            then
                                if
                                    08B7:   test Bit_sets bit Icon
                                then
                                    if
                                        3@ == 69 //  
                                    then
                                        0E1E: draw_texture_plus Battery_icon event 1 pos 4@ 5@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 1@ 2@ 7@ 6@
                                    else
                                        0E1E: draw_texture_plus Gasoline_png event 1 pos 4@ 5@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 1@ 2@ 7@ 6@
                                    end
                                
                                    //   F
                                    0087: 3@ = Line_Position_Y // (float)
                                    0087: 7@ = Line_size_y // (float)
                                    0087: 8@ = Line_size_x // (float)
                                    0087: 1@ = 7@ //  
                                    1@ /= 2.0 //   
                                    0087: 5@ = 3@ // (float)
                                    0063: 5@ -= 1@  // (float)
                                    0087: 1@ = 8@ //  
                                    1@ /= 1.9 //    X
                                
                                    if
                                        08B7:   test Bit_sets bit Icon_Position_2
                                    then
                                        0063: 5@ -= 1@  //   X
                                    end
                                
                                    1@ /= 1.5 //    X
                                
                                    if or
                                        08B7:   test Bit_sets bit Icon_Position_1
                                        08B7:   test Bit_sets bit Icon_Position_3
                                    then
                                        0063: 5@ -= 1@  //   X
                                    end
                                end
                                
                                
                            else // Horizontal
                                if
                                    08B7:   test Bit_sets bit Icon
                                then
                                    if
                                        3@ == 69 //  
                                    then
                                        0E1E: draw_texture_plus Battery_icon event 1 pos 5@ 4@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 1@ 2@ 7@ 6@
                                    else
                                        0E1E: draw_texture_plus Gasoline_png event 1 pos 5@ 4@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 1@ 2@ 7@ 6@
                                    end
                                
                                    //   F
                                    0087: 3@ = Line_Position_X // (float)
                                    0087: 7@ = Line_size_x // (float)
                                    0087: 1@ = 7@ //  
                                    1@ /= 2.0 //   
                                    0087: 5@ = 3@ // (float)
                                    005B: 5@ += 1@  //  
                                    0087: 1@ = 8@ //  
                                    1@ /= 3.4 //    X
                                    if
                                        08B7:   test Bit_sets bit Icon_Position_3
                                    then
                                        005B: 5@ += 1@  //   X
                                    else
                                        0063: 5@ -= 1@  //   X
                                    end
                                end
                            end
                            
    
    
                            //    F.    ,       F      ,    
                            if Green_color > 100
                            then Green_color = 100
                            end
                            
                            //      F
                            0A97: 3@ = car Car_gasoline struct
                            0D4E: 7@ = struct 3@ offset 0x9 size 4
                            3@ = Gas_full
                            0062: 3@ -= 7@  // (int)
                            if
                                3@ < 5
                            then
                                //  
                                if
                                    timerb > 500
                                then
                                    Green_color = 250
                                    if
                                        timerb > 1000
                                    then
                                        timerb = 0
                                    end
                                else
                                    Green_color = 100
                                end
                            end
                            if
                                08B7:   test Bit_sets bit Icon
                            then
                                if
                                    08B7:   test Bit_sets bit Mode_V
                                then
                                    0E1E: draw_texture_plus Full_mark event 1 pos 4@ 5@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 200 200 200 Green_color
                            
                                else // Horizontal
                            
                                    0E1E: draw_texture_plus Full_mark event 1 pos 5@ 4@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 200 200 200 Green_color
                                end
                            end
                        
                        end
                        
                        //    
                        02E3: 1@ = car Car_gasoline speed
                        if
                            1@ > 1.0
                        then
                            0092: 1@ = float 1@ to_integer
                            1@ *= 2
                            005A: timera += 1@  // (int)
                        end
                        
                        //     
                        0EFD: get_car_pedals Car_gasoline gas_to 2@ break_to 3@
                        if
                            2@ == 1.0
                        then
                            timera += 12
                        end
                        
                        if
                            08B7:   test Bit_sets bit Oil_leaking
                        then
                            0E12: get_vehicle Car_gasoline subclass_to 1@
                            if or
                                1@ == 0
                                1@ == 1
                                1@ == 2
                                1@ == 9
                            then
                                0227: 1@ = car Car_gasoline health
                                if
                                    1@ < 500
                                then

                                    0085: 2@ = Time_gas // (int)
                                    2@ /= 10
                                    005A: timera += 2@  // (int)
                                end
                            end
                        end
                        
                        //         
                        if
                            8ABE:   not car Car_gasoline engine_on
                        then
                            0E12: get_vehicle Car_gasoline subclass_to 1@
                            if or
                                1@ == 4 // 
                                1@ == 0 // 
                            then
                                0A97: 1@ = car Car_gasoline struct
                                0D4E: 1@ = struct 1@ offset 0x9 size 4
                                if and
                                    1@ < 200 //         
                                    1@ > 100
                                then
                                    0ABF: set_car Car_gasoline engine_state_to 1
                                end
                            end
                        end
                            
                        
                        if and
                            0ABE:   car Car_gasoline engine_on
                            001D:   timera > Time_gas  // (int)
                        then
                            0A97: 1@ = car Car_gasoline struct
                            0D4E: 2@ = struct 1@ offset 0x9 size 4
                            
                            //     
                            if
                                2@ < Gas_empty
                            then
                                0E12: get_vehicle Car_gasoline subclass_to 1@
                                if or
                                    1@ == 0 // 
                                    1@ == 1 //  
                                    1@ == 4 // 
                                then
                                    0ABF: set_car Car_gasoline engine_state_to 0
                                else
                                    if
                                        1@ == 3 // 
                                    then
                                        0A97: 1@ = car Car_gasoline struct
                                        0E28: write_struct 1@ offset 0x84C size 4 value 0.03 // fRotorSpeed
                                    else
                                        02D4: car Car_gasoline turn_off_engine //  
                                    end
                                end
                                continue
                            end
                            
                            //     
                            2@ -= 1
                            0E28: write_struct 1@ offset 0x9 size 4 value 2@
                            timera = 0
                        end
                    else
                        //  ,          
                        08BD: set 2@ bit 1
                        0A97: 1@ = car Car_gasoline struct
                        0E28: write_struct 1@ offset 0x8 size 1 value 2@
                        if $ONMISSION == 0
                        then 0209: 2@ = random_int_in_ranges 400 Gas_full
                        else 0209: 2@ = random_int_in_ranges 750 Gas_full
                        end
                        0E28: write_struct 1@ offset 0x9 size 4 value 2@
                    end
                end
            end
        else
            08C3: clear Bit_sets bit Sound_War
            08C3: clear Bit_sets bit Sound_Gus
            gosub @Sound_remove
            gosub @Sound_remove_gasup
            //        
            if and
                80DF:   not actor $PLAYER_ACTOR driving
                $ACTIVE_INTERIOR == 0
                $ONMISSION == 0
            then
                Find_obj = 0
                while 0EA8: get_any_car_no_save_recursive Find_obj progress_to Find_obj car_to Car_gasoline
                    0A97: 1@ = car Car_gasoline struct
                    0D4E: 2@ = struct 1@ offset 0x428 size 1 // m_nVehicleFlags ,        
                    if or
                        2@ == 0 //   
                        2@ == 32 //   
                    then
                        0A97: 1@ = car Car_gasoline struct
                        0D4E: 2@ = struct 1@ offset 0x8 size 1
                        if
                            88B7:   not test 2@ bit 1 //    
                        then
                            08BD: set 2@ bit 1
                            0E28: write_struct 1@ offset 0x8 size 1 value 2@
                            2@ = Gas_full
                            0E28: write_struct 1@ offset 0x9 size 4 value 2@
                        end
                    end
                end
            end
        end
    end
end


:Petrol
//      
0087: 3@ = Line_Position_X // (float)
0087: 4@ = Line_Position_Y // (float)
0087: 7@ = Line_size_x // (float)
0087: 8@ = Line_size_y // (float
if
    010A:   player $PLAYER_CHAR money > 1
then
    0A97: 1@ = car Car_gasoline struct
    0D4E: 2@ = struct 1@ offset 0x9 size 4
    2@ += 2
    if 2@ >= Gas_full
    then 2@ = Gas_full
    end
    0E28: write_struct 1@ offset 0x9 size 4 value 2@
    if
        2@ < Gas_full
    then
        gosub @Sound_load_gasup
        //      ( )
        if and
            is_hud_visible
            is_local_var_bit_set_const Bit_sets HUD_Enabled_bit
        then
            if
                timerb > 500
            then
            
                if
                    08B7:   test Bit_sets bit Mode_V
                then
                    if
                        08B7:   test Bit_sets bit Icon
                    then
                        0087: 2@ = 4@ // (float)
                        0087: 5@ = 3@ // (float)
                        0087: 1@ = 8@ // (float)
                        1@ /= 1.9
    
                        if or
                            08B7:   test Bit_sets bit Icon_Position_1
                            08B7:   test Bit_sets bit Icon_Position_2
                        then
                            005B: 5@ += 1@  //  
                        end
                        if
                            08B7:   test Bit_sets bit Icon_Position_3
                        then
                            0063: 5@ -= 1@  //  
                        end
                
                        0E1E: draw_texture_plus Gas_up_icon event 1 pos 5@ 2@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 200 200 200 100
                    
                    end
                
                else // Horizontal
                    if
                        08B7:   test Bit_sets bit Icon
                    then
                        0087: 2@ = 4@ // (float)
                        0087: 5@ = 3@ // (float)
                        0087: 1@ = 8@ // (float)
                        1@ /= 1.9
    
                        if or
                            08B7:   test Bit_sets bit Icon_Position_1
                            08B7:   test Bit_sets bit Icon_Position_3
                        then
                            0063: 2@ -= 1@  //  
                        end
                        if
                            08B7:   test Bit_sets bit Icon_Position_2
                        then
                            005B: 2@ += 1@  //  
                        end
    
                        0E1E: draw_texture_plus Gas_up_icon event 1 pos 5@ 2@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 200 200 200 100
                    
                    end
                end
            end
        end
        if
            timerb > 1000
        then
            0109: player $PLAYER_CHAR money += -20
            timerb = 0
        end
//        0109: player $PLAYER_CHAR money += -1
    else
        gosub @Sound_remove_gasup
    end
else
    //         
    if and
        is_hud_visible
        is_local_var_bit_set_const Bit_sets HUD_Enabled_bit
    then
        if
            timerb > 500
        then
        
            if
                08B7:   test Bit_sets bit Mode_V
            then
                if
                    08B7:   test Bit_sets bit Icon
                then
                    0087: 2@ = 4@ // (float)
                    0087: 5@ = 3@ // (float)
                    0087: 1@ = 8@ // (float)
                    1@ /= 1.9
            
                    if or
                        08B7:   test Bit_sets bit Icon_Position_1
                        08B7:   test Bit_sets bit Icon_Position_2
                    then
                        005B: 5@ += 1@  //  
                    end
                    if
                        08B7:   test Bit_sets bit Icon_Position_3
                    then
                        0063: 5@ -= 1@  //  
                    end
            
                    0E1E: draw_texture_plus no_money event 1 pos 5@ 2@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 255 30 0 150
                    if
                        timerb > 1000
                    then
                        timerb = 0
                    end
                end
                
            else // Horizontal
                if
                    08B7:   test Bit_sets bit Icon
                then
                    0087: 2@ = 4@ // (float)
                    0087: 5@ = 3@ // (float)
                    0087: 1@ = 8@ // (float)
                    1@ /= 1.9
    
                    if or
                        08B7:   test Bit_sets bit Icon_Position_1
                        08B7:   test Bit_sets bit Icon_Position_3
                    then
                        0063: 2@ -= 1@  //  
                    end
                    if
                        08B7:   test Bit_sets bit Icon_Position_2
                    then
                        005B: 2@ += 1@  //  
                    end
    
                    0E1E: draw_texture_plus no_money event 1 pos 5@ 2@ size Size_icon Size_icon angle 0.0 depth 0 1 0 0 rgba 255 30 0 150
                    if
                        timerb > 1000
                    then
                        timerb = 0
                    end
                end
            
            end
        end
    end
end
return

:Sound_load
if and
    88B7:   not test Bit_sets bit Sound_Gus
    Sound_play == -1
then
    0AAC: Sound_play = load_audio_stream "Sound\Warning.mp3"
    0ABC: set_audio_stream Sound_play volume Sound_volume
    08BD: set Bit_sets bit Sound_War
end
return

:Sound_remove
if and
    88B7:   not test Bit_sets bit Sound_Gus
    not Sound_play == -1
then
    0AAE: remove_audio_stream Sound_play
    Sound_play = -1
    08C3: clear Bit_sets bit Sound_War
end
return

:Sound_load_gasup
if
    Sound_play == -1
then
    0AAC: Sound_play = load_audio_stream "Sound\GasUp.mp3"
    0ABC: set_audio_stream Sound_play volume Sound_gasUp_volume
    0AAD: set_audio_stream Sound_play state 1
    0AC0: audio_stream Sound_play looped 1
    08BD: set Bit_sets bit Sound_Gus
else
    if
        88B7:   not test Bit_sets bit Sound_Gus
    then
        0AAE: remove_audio_stream Sound_play
        Sound_play = -1
        08BD: set Bit_sets bit Sound_Gus
        08C3: clear Bit_sets bit Sound_War
    end
end
return

:Sound_remove_gasup
if and
    88B7:   not test Bit_sets bit Sound_War
    not Sound_play == -1
then
    0AAE: remove_audio_stream Sound_play
    Sound_play = -1
    08C3: clear Bit_sets bit Sound_Gus
end
return

:Electro_engine
0A97: 3@ = car Car_gasoline struct
0D4E: 3@ = struct 3@ offset 0x384 size 4
3@ += 0x2c
0D4E: 3@ = struct 3@ offset 0x49 size 1
return

:Stopped
1@ = false
0E12: get_vehicle Car_gasoline subclass_to 2@
if or
    0137:   car Car_gasoline model == 539
    2@ == 5 // 
then
    02E3: 2@ = car Car_gasoline speed
    if
        2@ < 2.0
    then
        1@ = true
    end
else
    if
        01C1:   car Car_gasoline stopped
    then
        1@ = true
    end
end
return

:Visual_INI
0AF2: Sound_volume = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Sound Volume"
0AF2: Sound_gasUp_volume = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Sound Volume Gas Station"

08C3: clear Bit_sets bit Icon
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Icon"
if 0@ == 1
then 08BD: set Bit_sets bit Icon
end

08C3: clear Bit_sets bit onMission
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "On Mission"
if 0@ == 1
then 08BD: set Bit_sets bit onMission
end

08C3: clear Bit_sets bit HUD_Enabled_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Enable Indicator"
if 0@ == 1
then 08BD: set Bit_sets bit HUD_Enabled_bit
end

08C3: clear Bit_sets bit Oil_leaking
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Oil leaking mod"
if 0@ == 1
then 08BD: set Bit_sets bit Oil_leaking
end

08C3: clear Bit_sets bit Car_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Car"
if 0@ == 1
then 08BD: set Bit_sets bit Car_bit
end

08C3: clear Bit_sets bit Big_Car_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Big Car"
if 0@ == 1
then 08BD: set Bit_sets bit Big_Car_bit
end

08C3: clear Bit_sets bit Quad_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Quad"
if 0@ == 1
then 08BD: set Bit_sets bit Quad_bit
end

08C3: clear Bit_sets bit Heli_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Helicopter"
if 0@ == 1
then 08BD: set Bit_sets bit Heli_bit
end

08C3: clear Bit_sets bit Plane_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Plane"
if 0@ == 1
then 08BD: set Bit_sets bit Plane_bit
end

08C3: clear Bit_sets bit Boat_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Boat"
if 0@ == 1
then 08BD: set Bit_sets bit Boat_bit
end

08C3: clear Bit_sets bit Bike_bit
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Bike"
if 0@ == 1
then 08BD: set Bit_sets bit Bike_bit
end

08C3: clear Bit_sets bit Line_Static_Color
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Static Color"
if 0@ == 1
then 08BD: set Bit_sets bit Line_Static_Color
end

08C3: clear Bit_sets bit Line_Color_R
08C3: clear Bit_sets bit Line_Color_G
08C3: clear Bit_sets bit Line_Color_B
08C3: clear Bit_sets bit Line_Color_Y
08C3: clear Bit_sets bit Line_Color_W
08C3: clear Bit_sets bit Line_Color_BK
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Color"
if 0@ == 1
then 08BD: set Bit_sets bit Line_Color_R
end
if 0@ == 2
then 08BD: set Bit_sets bit Line_Color_G
end
if 0@ == 3
then 08BD: set Bit_sets bit Line_Color_B
end
if 0@ == 4
then 08BD: set Bit_sets bit Line_Color_Y
end
if 0@ == 5
then 08BD: set Bit_sets bit Line_Color_W
end
if 0@ == 6
then 08BD: set Bit_sets bit Line_Color_BK
end

08C3: clear Bit_sets bit Icon_Position_1
08C3: clear Bit_sets bit Icon_Position_2
08C3: clear Bit_sets bit Icon_Position_3
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Icon Position"
if 0@ == 1
then 08BD: set Bit_sets bit Icon_Position_1
end
if 0@ == 2
then 08BD: set Bit_sets bit Icon_Position_2
end
if 0@ == 3
then 08BD: set Bit_sets bit Icon_Position_3
end

08C3: clear Bit_sets bit Mode_trur_Everytime
08C3: clear Bit_sets bit Mode_Default
08C3: clear Bit_sets bit Mode_Everytime
08C3: clear Bit_sets bit Mode_Off
0AF0: 0@ = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Gas Station Scene" key "Mode"
if 0@ == 0
then 08BD: set Bit_sets bit Mode_Off
end
if 0@ == 1
then 08BD: set Bit_sets bit Mode_Default
end
if 0@ == 2
then 08BD: set Bit_sets bit Mode_Everytime
end
if 0@ == 3
then 08BD: set Bit_sets bit Mode_trur_Everytime
end

0AF2: Line_Position_X = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Position X"
0AF2: Line_Position_Y = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Position Y"
0AF2: Line_size_x = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Size X"
0AF2: Line_size_y = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Size y"
0AF0: Line_alpha = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Alpha"
0AF0: Line_frame_alpha = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Line Frame Alpha"
0AF0: Time_gas = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Settings" key "Time"
0AF0: Arrow_A = read_int_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Arrow Alpha"
0AF2: Size_icon = read_float_from_ini_file "cleo\Gasoline Mod.ini" section "Visual Settings" key "Size Icon"
return